home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / program / vol15n10.zip / JULIAN.AB next >
Text File  |  1996-01-28  |  2KB  |  35 lines

  1. '*********************************************************************
  2. ' Public Function DateToJulian( dtmDate )                 Access 95
  3. ' Converts the passed calendar date to a Julian Date number.
  4. '*********************************************************************
  5. Public Function DateToJulian(dtmDate As Date) As Long
  6. DateToJulian = (dtmDate - #1/1/100#) + 1757585
  7. End Function
  8.  
  9. '*********************************************************************
  10. ' Public Function JulianToDate( lngJulian )               Access 95
  11. ' Converts the passed julian date number to a calendar date
  12. '*********************************************************************
  13. Public Function JulianToDate(lngJulian As Long) As Date
  14. JulianToDate = lngJulian - 1757585 + #1/1/100#
  15. End Function
  16.  
  17. '*********************************************************************
  18. ' Public Function DateToNumericDayYear(dtmDate As Date)   Access 95
  19. ' Converts the passed date to the numeric day of the year (1-366)
  20. '*********************************************************************
  21. Public Function DateToNumericDayYear(dtmDate As Date) As Integer
  22. DateToNumericDayYear = dtmDate - _
  23.    DateSerial(DatePart("yyyy", dtmDate), 1, 1) + 1
  24. End Function
  25.  
  26. '*********************************************************************
  27. ' Public Function NumericDayYearToDate( intNum )           Access 95
  28. ' Converts the numeric day of the year (1-366) to a calendar date
  29. ' in the current year
  30. '*********************************************************************
  31. Public Function NumericDayYearToDate(intNum)
  32. NumericDayYearToDate = _
  33.   DateSerial(DatePart("yyyy", Date), 1, 1) + intNum - 1
  34. End Function
  35.